﻿#region Usings
using System.Linq;
using System.ServiceProcess;
using Lib.Utils.WorkerUtils;
#endregion

namespace BK.Import.Service
{
	public partial class BkImportService : ServiceBase
	{
		#region Fields
		private WorkerItemsContainer _workerItemsContainer;
		#endregion

		#region C'tors
		public BkImportService()
		{
			InitializeComponent();
		}
		#endregion

		#region Instance Methods
		protected override void OnPause()
		{
			_workerItemsContainer.Stop();
		}

		protected override void OnStart(string[] args)
		{
			_workerItemsContainer = new WorkerItemsContainer(new IWorkerItem[]
			                                                 	{
			                                                 		new BestExpenseFilesWorkerItem(),
			                                                 		new BestExpensesWorkerItem()
			                                                 	});
			_workerItemsContainer.Start();
		}

		protected override void OnStop()
		{
			_workerItemsContainer.Stop();
		}
		#endregion
	}
}